#include <stdio.h>

int Get_Pow(int x, int n)
{
    if(x < 0 || n < 0)
        return -1;
    if(n == 0)
        return 1;
    if(x == 0 || x == 1|| n == 1)
        return x;  
    return x*Get_Pow(x,n-1);
}

void Reverse(char s[], int start, int n)// asdfgh
{
    if(n <= 1)
        return ;
    if(s[start] == '\0')
        return;
    int t = s[start+n-1];
    for(int i = start+n-1; i >= start+1; i--)
    {
        s[i] = s[i-1];
    }
    s[start] = t;
    Reverse(s, start+1, n-1);
}
int Hanoi_move_num(int num)
{
	if(num <= 0)
        return 0;
   	if(num == 1)
        return 1;
    return Hanoi_move_num(num-1)*2+1;
}
void Print_Hanoi_path(int num,char start, char middle, char  stop)
{
    if(num <= 0)
        return ;
   	if(num == 1)
    {
        printf("%c ==> %c\n", start, stop);
        return;
    }
    Print_Hanoi_path(num-1,start, stop, middle);
    printf("%c ==> %c\n", start, stop);
    Print_Hanoi_path(num-1,middle, start, stop);
}
int main()
{
    // int x,n;
    // scanf("%d%d", &x, &n);
    // printf("%d\n", Get_Pow(x, n));
    //char s[] = "ehfigh";
    //sizeof(s)/sizeof(s[0])

    // Reverse(s,0,6);
    // printf("s = %s\n", s);// %s : 输出字符串直到遇到\0结束 
    int num;
    scanf("%d", &num);
    //printf("%d\n", Hanoi_move_num(num));
    Print_Hanoi_path(num,'A', 'B', 'C');
}